7 //Construye un triangulito de tres pisos que tiene la cima en el bloque (i,j).
9 int A
= a
[i
][j
], B
= a
[i
+2][j
], C
= a
[i
+2][j
+2];
11 a
[i
+1][j
] = (A
+B
-C
)/2; //X
12 a
[i
+1][j
+1] = (A
-B
+C
)/2; //Y
13 a
[i
+2][j
+1] = (A
-B
-C
)/2; //Z
20 for (int i
=0; i
<5; ++i
){
21 for (int j
=0; j
<=i
; ++j
){
25 for (int i
=0; i
<4; ++i
){
26 for (int j
=0; j
<=i
; ++j
){
31 for (int i
=0; i
<9; ++i
){
32 for (int j
=0; j
<=i
; ++j
){
33 cout
<< (j
>0?" ":"") << a
[i
][j
];